package extractor;

import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

import db.QueryPool;

public class ExtractorRunner {
	public static void main(String[] args) throws ClassNotFoundException, InterruptedException, SQLException, IOException {
		StateInfo stateinfo = new StateInfo();
		QueryPool query = new QueryPool();
		HashMap states = stateinfo.getHashMapStateInfo();
		String state = "";
		String geocode = "";
		String[] keyword = {"Obama"};
		String formalMaxID = "";
		
		
//		for (int i = 0; i < keyword.length; i++) {
//			for (int j = 0; j < StateInfo.STATES.length; j++) {
//				state = StateInfo.STATES[j];
//				geocode = (String) states.get(state);
//				//System.out.println("geocode = " + geocode);
//				formalMaxID = query.getSelectMaxIDInState(state,keyword[i] );
//				TweetGen tweet = new TweetGen(keyword[i], formalMaxID, state, geocode);
//				tweet.getTwitterMessage();
//			}
//			query.setAspects(formalMaxID,keyword[i]);
//		}
//		
//		query.setFilteredAspects();
//		
//		
//		System.out.println("A");
		HashMap category = new HashMap();
//		System.out.println("B");
		category = query.selectFilteredAspects();
		System.out.println("C");
		category = query.selectTopFiveAspects(category);
		System.out.println("D");
		query.insertFilteredTweetsByTopFiveAspects(category);
		
		
	}
}
